<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //var arr2 = [2,1,3]; 打印 最大值 最小值 和中间的值；
        var arr2 = [2,1,3];
        var min = arr2[0];
        if(arr2[1]<min){
            min = arr2[1];
        }
        if(arr2[2]<min){
            min = arr2[2] ;
        }
        var max = arr2[0];
        if(arr2[1]>max){
            max = arr2[1];
        }
        if(arr2[2]>max){
            max = arr2[2];
        }
        var middle = arr2[0];
        if(arr2[1]<max && arr2[1]>min){
            middle = arr2[1];
        }
        if(arr2[2]<max && arr2[2]>min){
            middle = arr2[2];
        }
        console.log("最大值是",max)
        console.log("最小值是",min)
        console.log("中间值是",middle)

        // var arr2 = [2,1,3];
        // console.log(Math.min(...arr2))
        // console.log(Math.max(2,1,3,6,9))

        
    </script>
</body>
</html>